﻿using SpiderMaster.AspNet.Management;
using SpiderMaster.Net;
using SpiderMaster.NetLibrary;

namespace SpiderMaster.AspNet
{
    public sealed partial class TradingCenter
    {
        /// <summary> Resets this instance.
        /// </summary>
        public void Reset()
        {
            //create a new empty ManagerData
            _Instance.Persisted = new TradingSystemData();
            Persisted.ApplicationName = Product.Current.Name; // TODO: Correct

            Persisted.DataDirectory = AspNetTradingSystem.DataDirectory.Left(AspNetTradingSystem.DataDirectory.LastIndexOf("/"));

            _Instance.SaveData();
        }
    }
}